﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Top.Api;
using System.Xml;
using CommonFramework.CommonConstant;

namespace MockTaoBaoServices
{
    public class BaseAPI
    {
        public static ITopClient client = new DefaultTopClient(ConfigConstant.UrlTest, ConfigConstant.AppkeySandBox, ConfigConstant.AppsecretSandBox);

        /// <summary>
        /// 获取Xml内容
        /// </summary>
        /// <param name="xmlName"></param>
        /// <returns></returns>
        public static string GetMockXml(string xmlName)
        {
            XmlDocument doc = new XmlDocument();
            int length = AppDomain.CurrentDomain.BaseDirectory.Length;
            string path = AppDomain.CurrentDomain.BaseDirectory.Substring(0, length - 7) + @"MockTaoBaoServices\MockXml\" + xmlName;
            doc.Load(path);

            return doc.InnerXml;
        }
    }
}
